package com.exampl.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.exampl.domain.Category;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface CategoryDao extends BaseMapper<Category> {

    // 无id_deleted这一约束的查找
    @Select("select * from category where name = #{name}")
    Category FindByName(String name);

    // 更新id_deleted
    @Update("update category set is_deleted = 0 where id = #{id}")
    void updateDelete(Long id);
}
